No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system, without permission in writing from the publisher. However, you are permitted to make copies of this work, printed or otherwise, as long as said copies are for your personal use only.
Introduction
------------
Sometimes the best ideas come to you in the middle of the night. In a dream, or perhaps in a restless fit of imagination, you discover the answer to the problem that has been perplexing you for days. Sometimes the ideas just don't come. If this happens to you, read on weary reader...
Dialback Security
-----------------
Q: I have a host that I dial into that asks for a security password, hangs up, and dials me back. Is there a good way of automating this procedure in MicroPhone?
- J. Redmond
Spokane, WA
A: The best way to automate this procedure would be to write a modem driver designed for dialback security. However, there is a simpler alternative. The following script assumes that your host will answer the call by asking for a password and dialback phone number, hang up, and return your call.
Dial Service "'Secure System'"
Wait for Text "'Password: '"
Send Text String "'apples@oranges^M'"
Wait for Text "'Dialback: '"
Send Text String "'555-1212^M'"
When Text Equals "'authorized'"
Remark "--- password and dialback were correct"
Remark "--- let's hang up and wait for host to return call"
Hang Up
Wait for Call
Or When Seconds Have Passed "30"
Remark "--- password and/or dialback were invalid"
Remark "--- host will not return call"
Hang Up
Alert OK "'Something went wrong. Verify password and dialback.'"
End When
In the above script example, you dial the host and wait for it to respond with the password prompt. Upon receiving the prompt, you send out your password followed by a carriage return. The host then asks for your dialback number. You respond with your dialback number and wait for the host to authorize the dialback, which will happen within 30 seconds. If authorization occurs, you hang up and wait for the host to return your call. Otherwise, you simply hang up and post a message to yourself reminding you that something went wrong.
Sitting in the Background
-------------------------
Q: I want to keep MicroPhone running in the background, but I don't want it hogging the serial port since I might want to run another comm program such as America Online. How can I keep it from interfering with other software?
- P. Simmons
Atlanta, GA
A: Under the Phone menu, there is a menu item called Close (Open) Connection. If the menu item says Close Connection, choose it. This will release the current port from use by MicroPhone. If you go back to the menu, you'll notice that it will say Open Connection. This allows you to reopen a connection. If you are not going to be using the port for a while, keep it closed and open it only when you need it opened.
Beeps and Failed Transfers
--------------------------
Q: Sometimes I need to cancel a ZMODEM receive while the transfer is in progress. This causes lots of garbage to appear on the screen. I have a pretty long beep sound, and it seems to get played an awful lot while the garbage flows onto the screen. Is there any way to prevent this from happening?
- T. Mitchell
Hope, AR
A: Go to the Settings menu and choose Preferences. From this dialog, make sure that the option for "Turn off non-script sounds" is unchecked. Click the Save button to make this preference permanent. This will prevent the annoying beep sounds during cancelled ZMODEM receives.
Keeping Track
-------------
Q: I know that MicroPhone has a built-in timer. How can I take advantage of it from scripting in order for me to keep track of my online sessions?
- J. Brahms
Chicago, IL
A: There are several script commands in MicroPhone that allow you to manipulate the built-in timer. For example, if you want to reset the timer to zero and begin ticking away after you've dialed a particular service, try this script:
Dial Service "'Particular Service'"
Timer Set Value "0"
Timer Run
Clock Set Mode to Timer
Modem Driver Beeps
------------------
Q: When I use Dial Service, MicroPhone beeps three times after a successful connection. How can I make it not beep?
- E. Ludlow
Sacramento, CA
A: The best way to do this is modify the modem driver. You can modify any of MicroPhone's modem drivers except Standard. If you are using Standard, Standard (autobaud) is a good alternative.
First, go to the Script menu and choose Edit Scripts. Then, choose Modem Driver from the Script Type popup menu. At this point, go to the File menu and choose Open Modem Driver. In this example, I'll modify Standard (autobaud). Choose the Dial Service script from the list of script, and then click the Modify button in the Script Manager. Near the end of the script, you'll notice the following commands:
When Expression "Pos('CONNECT',TheLine(CursorRow - 1)) > 0"
Set Variable * b_rate from Expression "BaudRate"
If Line Contains "'38400'"
Set Comm Param Baud Rate 38,400
Else If Line Contains "'19200'"
Set Comm Param Baud Rate 19,200
Else If Line Contains "'9600'"
Set Comm Param Baud Rate 9600
Else If Line Contains "'2400'"
Set Comm Param Baud Rate 2400
Else If Line Contains "'1200'"
Set Comm Param Baud Rate 1200
Else If Line Contains "'CONNECT'"
Set Comm Param Baud Rate 300
End If
Beep
Beep
Beep
Set Variable * online from Expression "TRUE"
Dialog Discard
Return Success
...
Remove the three beep commands and click OK in the Script Editor. Then, go to the File menu and choose Save Modem Driver. That's it!
Leading Zeros
-------------
Q: When I name my files, I use the current day, month, and year. How can I put leading zeroes on these number? I want 04/07/93, not 4/7/93. Please help!
- T.J. Kirkpatrick
A: What you want to do is add a zero to the beginning of the number, regardless of whether it needs it or not. Then, just take the last two digits in the number. If the zero is not needed, it gets stripped out. If it is needed, then you have your leading zero. I usually delete variables I no longer need, hence the delete variable commands. Take a look at the following script:
Set Variable myDay from Expression "'0' & String(Day)"
Set Variable myDay from Expression "Mid(myDay,Length(myDay) - 1,2)"
Set Variable myMonth from Expression "'0' & String(Month)"
Set Variable myMonth from Expression "Mid(myMonth,Length(myMonth) - 1,2)"
Set Variable myYear from Expression "'0' & String(myYear)"
Set Variable myYear from Expression "Mid(myYear,Length(myYear) - 1,2)"
Set Variable myAll from Expression "myDay & '/' & myMonth & '/' & myYear"
Delete Variable myDay
Delete Variable myMonth
Delete Variable myYear
Final Thoughts
--------------
If you've got a specific question, or need to know how a certain aspect of MicroPhone works, send us some mail. We'll try to get as many of your questions answered in future editions of this column. And, who knows? Maybe your question will prompt an entire article to be written!